package io.lvdaxian.handwriting.thread;

public class Thread01 {
  public static void main(String[] args) throws InterruptedException {
    Thread thread = new Thread(() -> {
      try {
        while (true) {
          Thread.sleep(1000);
          System.out.println("线程运行中 ...");
        }
      } catch (InterruptedException e) {
        throw new RuntimeException(e);
      }
    });
    
    System.out.println(thread.getState());
    
    thread.start();
    System.out.println(thread.getState());
    
    Thread.sleep(1000);
    
    thread.start();
  }
}
